<template>
    <BasicModal v-bind="$attrs" @register="registerModal" :title="displayModuleTitle" @ok="onButtonOkClick" okText="返回"
        :showCancelBtn="false">
        <a-textarea :value="timeArray" style="font-size: 15px;" :autosize="{ minRows: 4, maxRows: 10 }" />
    </BasicModal>
</template>
<script lang="ts">
import { defineComponent, ref, unref, computed } from 'vue';
import { BasicModal, useModalInner } from '/@/components/Modal';
import { QcUnifyTransToChildProps } from '/#/QcUnify';
import { displayTitle } from '/@/utils/QcUnifyUtil';
export default defineComponent({
    components: { BasicModal },
    name: 'TimeArrayModal',
    setup() {
        const timeArray = ref<string>('');
        //弹出窗口界面是新增数据、修改数据；根据传递过来的参数进行判断
        const qcUnifyProps = ref<QcUnifyTransToChildProps>();
        const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
            setModalProps({ confirmLoading: false, width: 450 });
            let unrefData = unref(data);
            qcUnifyProps.value = unrefData;
            timeArray.value = unrefData.timeArray;
        });
        function onButtonOkClick() {
            closeModal();
        }
        let displayModuleTitle = computed(() => {
            return displayTitle(qcUnifyProps.value);
        });

        return {
            registerModal,
            displayModuleTitle,
            closeModal,
            timeArray,
            onButtonOkClick
        };
    },
});
</script>